﻿package net.wangit.user;

import net.wangit.Element;
import net.wangit.User;
import net.wangit.framework.action.ActionMapping;

@SuppressWarnings("serial")
public class Guest implements User {
	private static final String ID = "guest";
	private static final String NAME = "guest";
	private static final String NULL_ARRAY[] = new String[0];

	public Guest() {
	}

	public String get(String name) {
		if ("userid".equals(name))
			return getId();
		if ("username".equals(name))
			return getName();
		else
			return "";
	}

	public String getId() {
		return Guest.ID;
	}

	public String getName() {
		return Guest.NAME;
	}

	public void set(String s, String s1) {
	}

	public String getOrgId() {
		return "";
	}

	public String[] getAllRoles() {
		return NULL_ARRAY;
	}

	public boolean containsRole(String roleId) {
		return false;
	}

	public String[] getGroups() {
		return NULL_ARRAY;
	}

	public boolean containsGroup(String groupId) {
		return false;
	}

	public boolean hasUnitPrivilege(String domain, String unitId,
			String unitShowMode) {
		return false;
	}

	public boolean hasActionPrivilege(ActionMapping am) {
		return false;
	}

	public boolean hasElementPrivilege(Element element) {
		return false;
	}

	public boolean hasDataPrivilege(Object key) {
		return false;
	}

}
